<template>
    <h2>分配权益列表</h2>
    <table border="1">
        <thead>
            <tr>
    <td><input type="checkbox"></td>
    <td>ID</td>
    <td>权益名称</td>
    </tr>
        </thead>
        <tbody>
    <tr v-for="item in list">
    <td><input type="checkbox"></td>
    <td>{{item.rightsId}}</td>
    <td>{{item.rightsName}}</td>
</tr>
        </tbody>
        <input type="button" value="确认">
    </table>
    
</template>

<script setup lang="ts">
import axios from "axios";
import {onMounted,toRefs,reactive} from 'vue';
import {useRouter} from 'vue-router';
const router = useRouter();

const data:any=reactive({
    state:{
        
    },
    list:[],
    
})
const {state,list}=toRefs(data);
onMounted(()=>{
    getlist();
})



//显示
//console.log是在网页打印信息
const getlist=()=>{
    console.log(state.value);
    axios({
        url:'/api/Member/ShowRights',
        method:'get',
        params:state.value
    })
    .then(res=>{
        console.log(res);
        list.value=res.data;
       
    })
    .catch(err=>{
        console.log(err);
    })
}


</script>